package net.lee.shiro.demo.entity.usersystem;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "role", schema = "admin_system", catalog = "")
public class RoleEntity {
    private long roleId;
    private String roleName;
    private String roleRemark;
    private Long moduleId;

    @Id
    @Column(name = "role_id")
    public long getRoleId() {
        return roleId;
    }

    public void setRoleId(long roleId) {
        this.roleId = roleId;
    }

    @Basic
    @Column(name = "role_name")
    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    @Basic
    @Column(name = "role_remark")
    public String getRoleRemark() {
        return roleRemark;
    }

    public void setRoleRemark(String roleRemark) {
        this.roleRemark = roleRemark;
    }

    @Basic
    @Column(name = "module_id")
    public Long getModuleId() {
        return moduleId;
    }

    public void setModuleId(Long moduleId) {
        this.moduleId = moduleId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RoleEntity that = (RoleEntity) o;
        return roleId == that.roleId &&
                Objects.equals(roleName, that.roleName) &&
                Objects.equals(roleRemark, that.roleRemark) &&
                Objects.equals(moduleId, that.moduleId);
    }

    @Override
    public int hashCode() {

        return Objects.hash(roleId, roleName, roleRemark, moduleId);
    }
}
